package com.lw.oss.controller;

import com.lw.commonutil.result.Result;
import com.lw.oss.service.OssService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;


@RestController
@RequestMapping("/admin/oss/file")
public class OssController {
    @Autowired
    private OssService ossService;
    //上传头像方法
    @PostMapping("/upload")
    public Result uploadFile(MultipartFile file){
        String url= ossService.uploadFile(file);
        return Result.ok( url );
    }
}
